<template>
	<view class="upopup">
		<view class="inside">
			<text>服务态度：</text>
			<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20" count="5" size="30" v-model="fcount" @change="howserve"></u-rate>
		</view>
	    <view class="inside">
	    	<text>治疗效果：</text>
			<u-rate active-color="#FA3534" inactive-color="#b2b2b2" gutter="20" count="5" size="30" v-model="scount" @change="howtreat"></u-rate>
	    </view>
		<view class="">
			<text>评价内容:</text>
			<u-textarea placeholder="请输入内容" count class="border" v-model="content" ></u-textarea>
		</view>
		<view class="bottom">
			<u-button type="primary" text="提交" @click="sub"></u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				fcount:0,
				scount:0,
				content:'',//内容
				serve:null,//服务
				treat:null,//治疗
				name:'高数'//名字
			}
		},
		methods:{
			howserve(e) {
				this.serve = e
				console.log(this.serve)
			},
			howtreat(e) {
				this.treat = e
				console.log(this.treat)
			},
			sub() {
				uni.request({
					url:'http://124.223.168.50:8000/booking/appraise/',
					method:'POST',
					data:{
						content:this.content,
						serve:this.serve,
						treat:this.treat,
						name:this.$store.state.name,
						open_id:this.$store.state.open_id
					},
					success: (res) => {
						uni.redirectTo({
							url:'../Appointmentoperation/Appointmentoperation'
						})
						console.log(res)
					}
				})
			}
		}
	}
</script>

<style scoped>
	.bottom {
		position: fixed;
		bottom: 0rpx;
		width: 750rpx;
	}
	.border {
		width: 700rpx;
		border: 1px solid lightgrey;
		margin: auto;
	}
</style>